home *** CD-ROM | disk | FTP | other *** search
- #ifndef SYSTEM_MODULES_H
- #define SYSTEM_MODULES_H TRUE
-
- /*
- ** $VER: modules.h V1.0
- **
- ** (C) Copyright 1996-1998 DreamWorld Productions.
- ** All Rights Reserved.
- **
- */
-
- #ifndef DPKERNEL_H
- #include <dpkernel/dpkernel.h>
- #endif
-
- #ifndef SYSTEM_GLOBALBASE_H
- #include <system/globalbase.h>
- #endif
-
- /*****************************************************************************
- ** Module Object.
- */
-
- #define VER_MODULE 1
- #define TAGS_MODULE ((ID_SPCTAGS<<16)|ID_MODULE)
-
- struct Module {
- struct Head Head; /* [00] Standard header */
- WORD Number; /* [12] Number of the associated module */
- APTR ModBase; /* [14] Ptr to function jump table */
- struct Segment *Segment; /* [18] Segment pointer */
- WORD TableType; /* [22] Type of table */
- WORD emp1; /* [24] */
- struct Function *FunctionList; /* [26] Array of functions */
- LONG Version; /* [30] Version of the module */
- LONG Revision; /* [34] Revision of the module */
- struct ModHeader *Table; /* [38] Header */
- BYTE *Name; /* [42] Name of the module */
- };
-
- struct Function {
- APTR Address;
- BYTE *Name;
- };
-
- #define MODA_Number (12|TWORD)
- #define MODA_TableType (22|TWORD)
- #define MODA_Version (30|TLONG)
- #define MODA_Revision (34|TLONG)
- #define MODA_Name (42|TAPTR)
-
- /*****************************************************************************
- ** Table-Type definitions.
- */
-
- #define JMP_DEFAULT 1 /* LVO jump type (standard) */
- #define JMP_AMIGAE 2 /* Amiga E jump table */
-
- #define JMP_LIBRARY JMP_AMIGAE
- #define JMP_LVO JMP_DEFAULT
-
- /*****************************************************************************
- ** Module file header.
- */
-
- #define MODULE_HEADER_V1 0x4D4F4401
-
- struct ModHeader {
- LONG Version;
-
- #ifdef _DCC
- LONG (*Init)(__A0 struct Module *, __A1 APTR DPKBase, __A2 struct GVBase *,
- __D0 LONG dpkVersion, __D1 LONG dpkRevision);
- void (*Close)(__A0 struct Module *);
- LONG (*Expunge)(void);
- #else
- #ifdef __SASC
- __asm LONG (*Init)(register __a0 struct Module *, register __a1 APTR DPKBase,
- register __a2 struct GVBase *, register __d0 LONG dpkVersion,
- register __d1 LONG dpkRevision);
- __asm void (*Close)(register __a0 struct Module *);
- __asm LONG (*Expunge)(void);
- #else
- LONG (*Init)(struct Module *, APTR DPKBase, struct GVBase *, LONG dpkVersion,
- LONG dpkRevision);
- void (*Close)(struct Module *);
- LONG (*Expunge)(void);
- #endif
- #endif
-
- WORD TableType; /* Type of function table to generate */
- WORD OpenCount; /* Amount of programs with this module open */
- BYTE *Author; /* Author of the module */
- struct Function *DefaultList; /* Pointer to default function list */
- LONG CPUNumber; /* CPU that this module is compiled for */
- LONG ModVersion; /* Version of this module */
- LONG ModRevision; /* Revision of this module */
- LONG MinDPKVersion; /* Minimum DPK version required */
- LONG MinDPKRevision; /* Minimum DPK revision required */
-
- #ifdef _DCC
- LONG (*Open)(__A0 struct Module *);
- #else
- #ifdef __SASC
- __asm LONG (*Open)(register __a0 struct Module *);
- #else
- LONG (*Open)(struct Module *);
- #endif
- #endif
-
- APTR ModBase; /* Generated function base for given CPU */
- BYTE *Copyright; /* Copyright details */
- BYTE *Date; /* Date of compilation */
- BYTE *Name; /* Name of the module */
- WORD DPKTable; /* Type of function table to get from DPK */
- WORD emp; /* Reserved */
- };
-
- /*****************************************************************************
- ** This structure is 100% private.
- */
-
- struct ModEntry {
- struct ModEntry *Next; /* Next module in list */
- struct ModEntry *Prev; /* Previous module in list */
- struct Segment *Segment; /* Module segment */
- struct ModHeader *Header; /* Pointer to module header */
- WORD ModuleID; /* Module ID */
- WORD empty; /* Reserved */
- BYTE *Name; /* Name of the module */
- };
-
- struct LVOFunction {
- WORD Jump;
- LONG Code;
- };
-
- /****************************************************************************/
-
- #define CPU_68000 1
- #define CPU_68010 2
- #define CPU_68020 3
- #define CPU_68030 4
- #define CPU_68040 5
- #define CPU_68060 6
-
- #endif /* SYSTEM_MODULES_H */
-
-